const state = {
  isTokenExpiredDialogShow: false,
  lastApiError: null,
  loading: false
}

const mutations = {
  SET_TOKEN_EXPIRED_DIALOG_SHOW(state, show) {
    state.isTokenExpiredDialogShow = show
  },
  SET_LAST_API_ERROR(state, error) {
    state.lastApiError = error
  },
  SET_LOADING(state, isLoading) {
    state.loading = isLoading
  }
}

const getters = {
  isTokenExpiredDialogShow: state => state.isTokenExpiredDialogShow,
  lastApiError: state => state.lastApiError,
  isLoading: state => state.loading
}

export default {
  namespaced: true,
  state,
  mutations,
  getters
}